<table class="table table-compact table-noborder">
  <thead>
    <tr>
      <th class="left">奖励</th>
      <th>数量</th>
      <th>效果</th>
      <th>总计</th>
    </tr>
  </thead>
  <tbody>
    <!-- Base -->
    <tr *ngIf="production">
      <td class="left">基础</td>
      <td></td>
      <td></td>
      <td>
        <app-formatted-quantity
          [class.text-danger]="production.ratio.lt(0)"
          [quantity]="production.ratio"
        ></app-formatted-quantity>
      </td>
    </tr>
    <!-- Additive Bonus -->
    <tr *ngIf="bonusAdd?.length > 0">
      <th colspan="4">附加奖励</th>
    </tr>
    <tr *ngFor="let item of bonusAdd; trackBy: bonusAddId">
      <td class="left">{{ item.base.name }}</td>
      <td>
        <app-formatted-quantity
          [quantity]="item.base.getQuantity()"
        ></app-formatted-quantity>
      </td>
      <td>
        <app-formatted-quantity
          [quantity]="item.quantity"
        ></app-formatted-quantity>
      </td>
      <td>
        <app-formatted-quantity
          [quantity]="item.quantity.times(item.base.getQuantity()).times(100)"
        ></app-formatted-quantity
        >%
      </td>
    </tr>

    <!-- Multiplicative Bonus -->
    <tr>
      <th colspan="4">倍率加成</th>
    </tr>
    <tr *ngFor="let item of bonusMulti; trackBy: bonusMulId">
      <td class="left">{{ item.base.name }}</td>
      <td>
        <app-formatted-quantity
          [quantity]="item.base.getQuantity()"
        ></app-formatted-quantity>
      </td>
      <td>
        <app-formatted-quantity
          [quantity]="item.quantity"
        ></app-formatted-quantity>
      </td>
      <td>
        x
        <app-formatted-quantity
          [quantity]="item.quantity.times(item.base.getQuantity()).plus(1)"
        ></app-formatted-quantity>
      </td>
    </tr>

    <!-- Operativity -->
    <tr *ngIf="production">
      <td class="left">
        Operativity
      </td>
      <td></td>
      <td></td>
      <td>
        <app-formatted-quantity
          [quantity]="production.producer.operativity"
        ></app-formatted-quantity>
        %
      </td>
    </tr>
  </tbody>
</table>
